package net.tarine.gastronomi.server.model;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Index;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Blob;
import com.google.appengine.api.users.User;
import com.google.gwt.user.client.rpc.IsSerializable;

@PersistenceCapable(detachable = "true")
public class GasUser implements IsSerializable, Serializable {
	private static final long serialVersionUID = -8417879174554655631L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;
	@Persistent
	private String gasId;
	@Persistent
	private Integer roleId;// lookup from AppConst class
	@Persistent
	private String nickname;// from User.getNickname();
	@Persistent
	private String email;// from User.getEmail();
	@Persistent
	private String phoneNumber;
	@Persistent
	@Index
	private String userId;// from User.getUserId();
	@Persistent
	private User user;
	@Persistent(serialized = "true")
	private Blob image;
	@Persistent
	private Boolean receiveForumEmail;
	@Persistent
	private Boolean receiveOrderEmail;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getGasId() {
		return gasId;
	}

	public void setGasId(String gasId) {
		this.gasId = gasId;
	}

	public Integer getRoleId() {
		return roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Blob getImage() {
		return image;
	}

	public void setImage(Blob image) {
		this.image = image;
	}

	public Boolean getReceiveForumEmail() {
		return receiveForumEmail;
	}

	public void setReceiveForumEmail(Boolean receiveForumEmail) {
		this.receiveForumEmail = receiveForumEmail;
	}

	public Boolean getReceiveOrderEmail() {
		return receiveOrderEmail;
	}

	public void setReceiveOrderEmail(Boolean receiveOrderEmail) {
		this.receiveOrderEmail = receiveOrderEmail;
	}

}
